package com.qqbot.core.message.support;

import com.alibaba.fastjson.JSON;
import com.qqbot.core.message.Message;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 音乐分享
 *
 * @author changwenpeng
 * @date 2022年5月9日
 */
@Data
@NoArgsConstructor
public class MusicMessage implements Message {

    private String type;

    private String subtype;

    private String id;

    private String url;

    private String audio;

    private String title;

    private String content;

    private String image;


    public MusicMessage(String id) {
        this.id = id;
    }

    public MusicMessage(String id, String type) {
        this.id = id;
        this.type = type;
    }

    public MusicMessage(String type, String subType, String url, String audio, String title, String content, String image) {
        this.type = type;
        this.subtype = subType;
        this.url = url;
        this.audio = audio;
        this.title = title;
        this.content = content;
        this.image = image;
    }

    @Override
    public String toString() {
        return "music[" + JSON.toJSONString(this) + "]";
    }

    @Override
    public String toMessageString() {
        return String.format("{\"type\":\"%s\",\"data\":%s}", "music", JSON.toJSONString(this));
    }

}
